
<?php
/*
 * @Descripttion:  validator 中的rule参数
 * @version: v1
 * @Author: Terriv
 * @Date: 2021-02-05 23:25:16
 * @LastEditors: Terry
 * @LastEditTime: 2024-12-16 14:27:01
 */
$prjCode = $_SERVER["HTTP_PUUID"] ?? '';
return [
    'admin' => [
        'digitalmachine' => [
            'type'    => [
                'getlist' => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                    'name|名称'       => 'max:100',
                ],
                'create'  => [
                    'name|名称'                             => 'require|max:100',
                    'subtitle|副标题'                        => 'max:100',
                    'repairTypeUuid|检修类型唯一码'              => 'requireWith:type',
                    'machineRiskTypeUuid|设备许可证类型唯一码'      => 'requireWith:type',
                    'heavyMachineCheckTypeUuid|重型检查类型唯一码' => 'requireWith:type',
                ],
                'update'  => [
                    'uuid|唯一码'                            => 'require',
                    'name|名称'                             => 'require|max:100',
                    'subtitle|副标题'                        => 'max:100',
                    'repairTypeUuid|检修类型唯一码'              => 'requireWith:type',
                    'machineRiskTypeUuid|设备许可证类型唯一码'      => 'requireWith:type',
                    'heavyMachineCheckTypeUuid|重型检查类型唯一码' => 'requireWith:type',
                ],
                'detail'  => [
                    'uuid|唯一码' => 'require',
                ],
            ],
            'machine' => [
                'detail'        => [
                    'uuid|设备唯一码' => 'require',
                ],
                'getlist'       => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                    'name|名称'       => 'max:100',
                ],
                'getrepairlist' => [
                    'page|页数'                  => "require|number",
                    'limit|每页显示总行数'            => "require|number|between:1,30",
                    'digitalMachineUuid|设备唯一码' => 'require',
                ],
                'create'        => [
                    // 'name|起重機械 / 起重裝置類別'                       => 'require|max:100',
                    // 'subtitle|英文標題'                  => 'max:100',
                    'machineSn|擁有人編號 / 序號'          => 'require|max:100',
                    'corpCode|擁有人'                  => 'require',
                    'digitalMacineTypeUuid|设备类型唯一码' => 'require',
                    'entryDate|到達日期'                => 'require',
                    'model|型號'                      => 'require',
                    'otherInfo|其他信息'                => 'array',
                    'files|附件'                      => 'array',
                ],
                'update'        => [
                    'uuid|唯一码'                      => 'require',
                    // 'name|名称'                       => 'require|max:100',
                    // 'subtitle|副标题'                  => 'max:100',
                    'machineSn|设备编号'                => 'require|max:100',
                    'digitalMacineTypeUuid|设备类型唯一码' => 'require',
                    'corpCode|企业唯一码'                => 'require',
                    'entryDate|进场时间'                => 'require',
                    'otherInfo|其他信息'                => 'array',
                    'files|附件'                      => 'array',
                ],
                'getrepairdata' => [
                    'digitalMachineRepairUuid|检修唯一码' => 'require',
                ],
                'exitmachines'  => [
                    'uuid|设备唯一码' => 'require|array',
                    'value|离场时间' => 'require',

                ],
                'entrymachines' => [
                    'uuid|设备唯一码' => 'require|array',
                    'value|进场时间' => 'require',

                ],
                'binddrivers'   => [
                    'uuid|设备唯一码' => 'require',
                    'value|驾驶员'  => 'array',

                ],
            ],
        ],
        'risk'           => [
            'type'  => [
                'getlist' => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                ],
                'create'  => [
                    'name|名称'       => 'require|max:100',
                    'corpCode|所属企业' => "require",
                    'flowUuid|所属流程' => "require",
                ],
                'update'  => [
                    'name|名称'       => 'require',
                    'uuid|唯一码'      => 'require',
                    'corpCode|所属企业' => "require",
                    'flowUuid|所属流程' => "require",
                ],
                'destroy' => [
                    'uuid|唯一码' => 'require',
                ],
            ],
            'index' => [
                'getlist'   => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                    'status|状态'     => "in:0,1,2",
                ],
                'getdetail' => [
                    'uuid|唯一码' => 'require',
                ],
                'audit'     => [
                    'uuid|唯一码'    => 'require|array',
                    'status|状态'   => "in:1,-1",
                    'reason|拒绝原因' => "requireIf:status,-1",
                ],
                'destroy'   => [
                    'uuid|唯一码' => 'require|array',
                ],
            ],

        ],
        'file'           => [
            'type'  => [
                'getlist'     => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                ],
                'create'      => [
                    'name|名称'       => 'require|max:100',
                    'isSecond|二级要求' => "require",
                ],
                'update'      => [
                    'name|名称'       => 'require|max:100',
                    'uuid|唯一码'      => 'require',
                    'isSecond|二级要求' => "require",
                ],
                'destroy'     => [
                    'uuid|唯一码' => 'require',
                ],
                'getfilelist' => [
                    'uuid|唯一码' => 'require',
                ],
                'changefile'  => [
                    'uuid|唯一码' => 'require',
                ],
            ],
            'index' => [
                'getlist' => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                ],
                'create'  => [
                    'name|名称'       => 'require|max:100',
                    'corpCode|所属企业' => "require",
                    'fileType|文件类型' => "require|in:1,2",
                    'file'          => "require",
                ],
                'update'  => [
                    'name|名称'       => 'require',
                    'corpCode|所属企业' => "require",
                    'fileType|文件类型' => "require|in:1,2",
                    'file'          => "require",
                    'uuid|唯一码'      => 'require',
                ],
                'destroy' => [
                    'uuid|唯一码' => 'require',
                ],
            ],
        ],
        'flow'           => [
            'index' => [
                'getlist' => [

                ],
                'create'  => [
                    'name|名称' => 'require|max:100',
                ],
                'update'  => [
                    'name|名称'  => 'require',
                    'uuid|唯一码' => 'require',
                ],
                'destroy' => [
                    'uuid|唯一码' => 'require',
                ],
            ],
            'form'  => [
                'getlist'    => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                    'flowUuid'      => "require",
                ],
                'create'     => [
                    'name|名称'        => 'require|max:100',
                    'flowUuid|所属流程'  => "require",
                    'type|表格类型'      => "require|in:1,2",
                    'linkForms|关联表单' => "array",
                    'signType|签署方式'  => "require|in:1,2",
                    'flowOrder|流程顺序' => "require",
                    'showOrder|展示顺序' => "require",
                    'formType|表单类型'  => "require|in:1,2",

                ],
                'update'     => [
                    'name|名称'        => 'require|max:100',
                    'flowUuid|所属流程'  => "require",
                    'type|表单类型'      => "require|in:1,2",
                    'signType|签署方式'  => "require|in:1,2",
                    'flowOrder|流程顺序' => "require",
                    'showOrder|展示顺序' => "require",
                    'uuid|唯一码'       => 'require',
                    'formType|表单类型'  => "require|in:1,2",
                ],
                'destroy'    => [
                    'uuid|唯一码' => 'require',
                ],
                'getalllist' => [
                    'flowUuid|流程唯一码' => 'require',
                ],
            ],
        ],
        'machinerisk'    => [
            'type'    => [
                'getlist' => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                ],
                'create'  => [
                    'name|名称'            => 'require|max:100',
                    'type|类型'            => 'require|between:1,2',
                    'closeFlowUuid|注销流程' => 'require',
                ],
                'update'  => [
                    'name|名称'            => 'require',
                    'uuid|唯一码'           => 'require',
                    'type|类型'            => 'require|between:1,2',
                    'closeFlowUuid|注销流程' => 'require',
                ],
                'destroy' => [
                    'uuid|唯一码' => 'require',
                ],
            ],
            'index'   => [
                'getlist'      => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                ],
                'getsublist'   => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                    'uuid|许可证唯一码'   => "require",
                ],
                'getsubdetail' => [
                    'uuid|唯一码' => "require",
                ],
            ],
            'subform' => [
                'getlist' => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                ],
                'create'  => [
                    'name|名称'       => 'require|max:100',
                    'flowUuid|所属流程' => "require",
                ],
                'update'  => [
                    'name|名称'  => 'require',
                    'uuid|唯一码' => 'require',

                ],
                'destroy' => [
                    'uuid|唯一码' => 'require',
                ],
            ],
        ],
        'train'          => [
            'getlist' => [
                'page|页数'       => "require|number",
                'limit|每页显示总行数' => "require|number|between:1,30",
                'name|名称'       => 'max:100',
                'corpCode|所属企业' => 'length:9,18',
            ],
            'create'  => [
                'name|名称'       => 'require|max:100|unique:certificate_worker,isDelete=0&projectCode=' . $prjCode . '&name',
                'corpCode|所属企业' => 'require|length:9,18',
                'lecturer'      => 'require',

            ],
            'update'  => [
                'name|电子证书名称'      => 'require|max:100',
                'uuid|唯一码'         => 'require',
                'corpCode|所属企业'    => 'require|length:9,18',
                'expiredTime|失效时间' => 'require',
                'lecturer'         => 'require',
            ],
            'destroy' => [
                'uuid|唯一码' => 'require',
            ],
        ],
        'checklist'      => [
            'index' => [
                'getlist'   => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                    'status|状态'     => "in:0,1,2,3,4",
                ],
                'getdetail' => [
                    'uuid|唯一码' => 'require',
                ],
                'destroy'   => [
                    'uuid|唯一码' => 'require|array',
                ],
            ],
            'type'  => [
                'getlist' => [
                    'page|页数'       => "require|number",
                    'limit|每页显示总行数' => "require|number|between:1,30",
                ],
                'create'  => [
                    'name|名称'       => 'require|max:100|unique:certificate_heavyMachineCheckType,isDelete=0&projectCode=' . $prjCode . '&name',
                    'corpCode|所属企业' => 'require|length:9,18',
                    'subtitle|副标题'  => 'max:150',
                    'flowUuid|所属流程' => 'require',
                ],
                'update'  => [
                    'name|名称'       => 'require|max:100',
                    'uuid|唯一码'      => 'require',
                    'corpCode|所属企业' => 'require|length:9,18',
                    'subtitle|副标题'  => 'max:150',
                    'flowUuid|所属流程' => 'require',
                ],
                'destroy' => [
                    'uuid|唯一码' => 'require',
                ],
            ],
        ],
        'area'           => [
            'getlist' => [
                'page|页数'       => "require|number",
                'limit|每页显示总行数' => "require|number|between:1,30",
                'name|名称'       => 'max:100',
            ],
            'create'  => [
                'name|名称' => 'require|max:100|unique:certificate_area,isDelete=0&projectCode=' . $prjCode . '&name',
            ],
            'update'  => [
                'name|电子证书名称' => 'require|max:100',
                'uuid|唯一码'    => 'require',
            ],
            'destroy' => [
                'uuid|唯一码' => 'require',
            ],
        ],
    ],
    'user'  => [
        'machine'            => [
            'getdata' => [
                "uuid|证书唯一码" => 'require',
            ],
            'create'  => [
                "uuid|证书唯一码" => 'require',
                "formData"   => 'require',
                "worker"     => 'require',
                "name"       => 'require',
                'uuid|设备唯一码' => 'require',
            ],
        ],
        'machineflow'        => [
            'getlist' => [
                'page|页数' => 'require|number',
            ],
            'create'  => [
                'description|内容'   => 'require|max:255',
                'itemUuid|设备详情唯一码' => 'require',
                'type|类型'          => 'require|in:0,1',
                'uuid'             => 'requireIf:type,1',
            ],
            'update'  => [
                'description|内容' => 'require|max:255',
                'type|类型'        => 'require|in:0,1',
                'itemUuid'       => 'require',
                'uuid'           => 'require',
            ],
        ],
        'permission'         => [
            'check' => [
                'machineUuid|设备证书唯一码' => 'require',
            ],
            'apply' => [
                'machineUuid|设备证书唯一码' => 'require',
            ],
        ],
        'risk'               => [
            'getdata'   => [
                "uuid|证书唯一码" => 'require',
            ],
            'getdetail' => [
                "uuid|证书唯一码" => 'require',
            ],
            'apply'     => [
                "typeUuid|类型唯一码"    => 'require',
                "formData|类型唯一码"    => 'require',
                "expiredTime|过期时间"  => 'require',
                "subcontractor|分判商" => 'require',
                "location|地点"       => 'require',
            ],
        ],
        'checklist'          => [
            'create'            => [
                'machineUuid|设备唯一码' => 'require',
                'areaUuid|区域唯一码'    => 'require',
            ],
            'checkrecordsubmit' => [
                'checkUuid|检查表唯一码' => 'require',
                // 'checkDate|检查日期'   => 'require',
                'formData|检查数据'    => 'require',
            ],
        ],
        'area'               => [
            'getlistbytypeuuid' => [
                'typeUuid|类型唯一码' => 'require',
            ],
        ],
        'machinerisk'        => [
            'getmachinedetail' => [
                'uuid|设备唯一码' => 'require',
            ],
            'apply'            => [
                'machineUuid|设备唯一码'  => 'require',
                'flowFormUuid|表单唯一码' => 'require',
                'formData|表单数据'      => 'require',
                'expiredTime|过期时间'   => 'require',
                'areaUuid|区域唯一码'     => 'require',
            ],
            'getlist'          => [
                'page|页数'  => 'require|number',
                'limit|页数' => 'require|number',
            ],
            'getdetail'        => [
                'uuid|唯一码' => 'require',
            ],
            'getnextform'      => [
                'uuid|唯一码' => 'require',
            ],
            'audit'            => [
                'uuid|许可证唯一码'        => 'require',
                'flowFormUuid|表单唯一码' => 'require',
                'formData|表单数据'      => 'require',
            ],
            'getrecorddetail'  => [
                'uuid|提交记录唯一码' => 'require',
            ],
        ],
        'machinerisksubform' => [
            'getmachinedetail'     => [
                'uuid|设备唯一码' => 'require',
            ],
            'apply'                => [
                'riskUuid|许可证唯一码'         => 'require',
                'subFormTypeUuid|附表类型唯一码' => 'require',
                'flowFormUuid|表单唯一码'      => 'require',
                'formData|表单数据'           => 'require',
                'expiredTime|过期时间'        => 'require',
            ],
            'getlist'              => [
                'riskUuid' => 'require',
                'page|页数'  => 'require|number',
                'limit|页数' => 'require|number',
            ],
            'getdetail'            => [
                'uuid|唯一码' => 'require',
            ],
            'getnextform'          => [
                'uuid|唯一码' => 'require',
            ],
            'audit'                => [
                'uuid|许可证唯一码'        => 'require',
                'flowFormUuid|表单唯一码' => 'require',
                'formData|表单数据'      => 'require',
            ],
            'getsubformtypelist'   => [
                'uuid|许可证唯一码' => 'require',
            ],
            'getsubformtypedetail' => [
                'uuid|附表类型唯一码' => 'require',
            ],
        ],
        'digitalmachine'     => [
            'getdigitalmachineriskdata'   => [
                'digitalMachineUuid|设备唯一码' => 'require',
            ],
            'getdigitalmachinerepairdata' => [
                'digitalMachineUuid|设备唯一码' => 'require',
            ],
            'getdigitalmachineheavydata'  => [
                'digitalMachineUuid|设备唯一码' => 'require',
            ],
        ],
        'repair'             => [
            'getmachinedetail' => [
                'uuid|设备唯一码' => 'require',
            ],
            'apply'            => [
                'machineUuid|设备唯一码'  => 'require',
                'flowFormUuid|表单唯一码' => 'require',
                'formData|表单数据'      => 'require',
                'title|报修标题'         => 'require',
                'description|问题描述'   => 'require',

            ],
            'getlist'          => [
                'page|页数'  => 'require|number',
                'limit|页数' => 'require|number',
            ],
            'getdetail'        => [
                'uuid|唯一码' => 'require',
            ],
            'getnextform'      => [
                'uuid|唯一码' => 'require',
            ],
            'audit'            => [
                'uuid|许可证唯一码'        => 'require',
                'flowFormUuid|表单唯一码' => 'require',
                'formData|表单数据'      => 'require',
            ],
            'getrecorddetail'  => [
                'uuid|提交记录唯一码' => 'require',
            ],
        ],
    ],
];
